<?php
/**
 * Created by PhpStorm.
 * User: Thans
 * Date: 2018/6/27
 * Time: 下午1:52
 */

namespace app\common\behavior;

use think\facade\Config;
use think\facade\Route;

class LoadOptions
{
    public function run($params)
    {
        $auto_options = cmf_auto_option();
        foreach ($auto_options as $key => $val) {
            Config::set($val['type'] . '.' . $val['option_name'], $val['option_value']);
        }
        //默认首页
        Route::rule('/', Config::get('system.web_index'));
    }
}